<template>
  <view class="container">
    <view class="titleBar" :style="{'top':  ''+ statusBarHeight  +'px'}">
      <image src="/static/images/indexpage/goback-icon.png" class="leftImg" @click="goback"></image>
      <!-- <image src="/static/images/indexpage/delete-icon.png" class="rightImg" @click="goback"></image> -->
    </view>

    <view class="bgBox">
      <u-swiper :list="otObj.imgList" height="1112" border-radius="0" mode="rect">
      </u-swiper>
    </view>
    <view class="bottom-box">
      <view class="price">
        <text class="symbol">￥</text>
        <text class="num">{{otObj.price}}</text>
      </view>
      <view class="describe">
        {{otObj.title}}
      </view>
      <text class="time">
        {{otObj.createtime}}
      </text>
      <view class="detail">
        <view class="detail-title">
          招标详情
        </view>
        <view class="detail-cont">
          <rich-text :nodes="otObj.main_content"></rich-text>
          <!-- {{otObj.main_content}} -->
        </view>
      </view>
    </view>
    <view v-if="showhand" class="bg-st" @click.stop="sethand()">
      <image src="/static/images/indexpage/xiahua-icon.png" class="shoushi" @click.stop="sethand()"></image>
    </view>
  </view>
</template>

<script>

import api from '@/api/index.js';
export default {
  data() {
    return {
      screenHeight: uni.getStorageSync('screenHeight') - uni.getStorageSync('safeAreaBottom'),
      safeareabottom: uni.getStorageSync('safeAreaBottom') + 48,
      statusBarHeight: uni.getStorageSync('statusBarHeight') + 10,
      imgList: [{
        image: '/static/images/indexpage/ershoubg.png',
        title: '昨夜星辰昨夜风，画楼西畔桂堂东'
      },
      {
        image: '/static/images/indexpage/ershoubg1.png',
        title: '身无彩凤双飞翼，心有灵犀一点通'
      },
      ],
      otObj: {
      },
      id: '',
      showhand: false
    };
  },
  onLoad(options) {
    this.id = options.id
    // uni.hideTabBar();
    this.init();
    if (uni.getStorageSync('isShowHand') == 'true' || uni.getStorageSync('isShowHand') == '') {
      this.showhand = true
      setTimeout(() => {
        this.showhand = false
        uni.setStorageSync('isShowHand', 'false');
      }, 2000);
    }
  },
  methods: {
    init() {
      this.getpage()
    },
    getpage() {
      api.base.getDev_inviteDetail({ id: this.id }).then(res => {
        if (res.code == 1) {
          this.otObj = res.data;
          this.otObj.main_content = res.data.main_content.replace(new RegExp('src="', 'g'), `style="max-width:100%!important;" src="`);
          this.otObj.imgList = []
          for (let i = 0; i < res.data.images.length; i++) {
            this.otObj.imgList.push({
              image: res.data.images[i],
              title: i
            })
          }
        } else {
          uni.showToast({
            title: res.msg,
            icon: 'none'
          });
        }
      });
    },
    goback() {
      uni.navigateBack(1)
    },
    publishComment() {
      // if (!queryParams.content) {
      //   uni.$u.toast("内容不能为空！！！")
      //   return
      // }
      // try {
      //   const data = api.home.publishComment(queryParams)
      //   queryParams.content = ""
      //   uni.$u.toast("评论成功")
      //   getCommentList()
      // } catch (e) {
      //   console.log(e);
      // }
      this.isShow = false
    },
    goWrith() {
      this.isShow = true
    },
    cancel(e) {
      this.contractObj.isShow = false
    },

    confirm(e) {
      this.contractObj.isShow = false
    },
    // showJubao(value) {
    //   this.popUpWinShow = !value
    // },
    toAllPrice(item) {
      //  跳转出价详情
      uni.navigateTo({
        url: `/pages/componets/requestGoods/requestGoodsDetail/allPricePage`
      });

    },
    toSetPrice() {
      uni.navigateTo({
        url: `/pages/componets/requestGoods/requestGoodsDetail/oneDetailPrice?disabled=` + false
      });
    }
  },
};
</script>

<style lang="less" scoped>
.container {
  position: relative;
  width: 100%;
  height: 100vh;
  background: #ffffff;

  // padding-bottom:120rpx;
  .titleBar {
    width: 100%;
    // height: 88rpx;
    color: #fff;
    font-size: 32rpx;
    line-height: 88rpx;
    font-weight: bold;
    display: flex;
    padding: 0 32rpx;
    align-items: center;
    justify-content: space-between;
    position: fixed;
    // top: 0px;
    right: 0px;
    z-index: 99;

    .leftImg {
      width: 48rpx;
      height: 48rpx;
    }

    .rightImg {
      width: 48rpx;
      height: 48rpx;
    }

    .fenImg {
      width: 48rpx;
      height: 50rpx;
    }
  }
}

.bgBox {
  position: absolute;
  width: 100vw;
  height: 1112rpx;
  overflow: hidden;
  top: 0;
  z-index: 0;
}

.bg-st {
  width: 100%;
}

.bottom-box {
  position: relative;
  top: 1042rpx;
  width: 750rpx;
  background: #ffffff;
  border-radius: 32rpx 32rpx 0rpx 0rpx;
  padding: 32rpx 32rpx 12rpx 32rpx;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  .price {
    height: 56rpx;
    font-size: 48rpx;
    font-family: HarmonyOS Sans-Bold, HarmonyOS Sans;
    font-weight: bold;
    color: #ff2544;
    line-height: 56rpx;

    .symbol {
      font-size: 24rpx;
      font-family: HarmonyOS Sans-Bold, HarmonyOS Sans;
      font-weight: bold;
      color: #ff2544;
    }

    .num {
      height: 56rpx;
      font-size: 48rpx;
      font-family: HarmonyOS Sans-Bold, HarmonyOS Sans;
      font-weight: bold;
      color: #ff2544;
    }
  }

  .describe {
    width: 100%;
    // height: 96rpx;
    font-size: 32rpx;
    font-family: PingFang SC-Bold, PingFang SC;
    font-weight: bold;
    color: #333333;
    line-height: 48rpx;
    margin: 28rpx 0 24rpx 0;
  }

  .time {
    width: 100%;
    font-size: 22rpx;
    font-family: PingFang SC-Medium, PingFang SC;
    font-weight: 500;
    color: #999999;
    line-height: 26rpx;
    margin-bottom: 28rpx;
  }

  .detail {
    width: 686rpx;
    background: #ffffff;
    border: 2rpx solid #f5f5f5;
    padding: 24rpx;
    box-sizing: border-box;

    &-title {
      width: 100%;
      height: 48rpx;
      font-size: 32rpx;
      font-family: PingFang SC-Bold, PingFang SC;
      font-weight: bold;
      color: #333333;
      line-height: 48rpx;
      text-align: left;
    }

    &-cont {
      margin-top: 24rpx;
    }
  }
}
.bg-st {
  position: absolute;
  width: 100%;
  height: 100vh;
  top: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 9999;
  display: flex;
  justify-content: center;
  .shoushi {
    width: 88rpx;
    height: 88rpx;
    position: absolute;
    bottom: 200rpx;
  }
}
</style>